.TH "Slurm API" "3" "Slurm job and step update functions" "April 2015" "Slurm job and step update functions"

.SH "NAME"
slurm_init_job_desc_msg, slurm_init_update_step_msg, 
slurm_update_job, slurm_update_job2, slurm_update_step
\- Slurm job and step update functions

.SH "SYNTAX"
.LP
#include <slurm/slurm.h>
.LP
void \fBslurm_init_job_desc_msg\fR (
.br
	job_desc_msg_t *\fIjob_desc_msg_ptr\fP
.br
);
.LP
void \fBslurm_init_update_step_msg\fR (
.br
	step_update_request_msg_t * \fIstep_msg\fP
.br
);
.LP
int \fBslurm_update_job\fR (
.br
	job_desc_msg_t * \fIjob_msg\fP
.br
);
.LP
int \fBslurm_update_job2\fR (
.br
        job_desc_msg_t * \fIjob_msg\fP,
        job_array_resp_msg_t **resp
.br
);
.LP
int \fBslurm_update_step\fR (
.br
	step_update_request_msg_t * \fIstep_msg\fP
.br
);
.LP
void \fBslurm_free_job_array_resp\fR (
.br
        job_array_resp_msg_t *resp
.br
);

.SH "ARGUMENTS"
.LP
.TP
\fIjob_msg\fP
Specifies the pointer to a job descriptor.
See slurm.h for full details on the data structure's contents.
.TP
\fIstep_msg\fP
Specifies the pointer to a step descriptor.
See slurm.h for full details on the data structure's contents.
.TP
\fIresp\fP
Array of error codes and job IDs.
Always use the \fBslurm_free_job_array_resp\fR function to release the memory
allocated to hold the error codes.

.SH "DESCRIPTION"
.TP 18
\fBslurm_init_job_desc_msg\fR
Initialize the contents of a job descriptor with default values.
Execute this function before issuing a request to submit or modify a job.
.TP
\fBslurm_init_update_step_msg\fR
Initialize the contents of a job step update descriptor with default values.
Execute this function before issuing a request to modify a job step.
.TP
\fBslurm_update_job\fR
Update a job with the changes made to the data structure passed as an argument
to the function.
.TP
\fBslurm_update_job2\fR
Update a job or job array with the changes made to the data structure passed
as an argument to the function.
Call the function \fBslurm_free_job_array_resp\fR to release memory allocated
for the response array.
.TP
\fBslurm_update_step\fR
Update a job step with the changes made to the data structure passed as an
argument to the function.
.TP
\fBslurm_free_job_array_resp\fR
Release memory allocated by the \fBslurm_suspend2\fR, \fBslurm_resume2\fR,
\fBslurm_requeue2\fR, and \fBslurm_update_job2\fR functions.

.SH "RETURN VALUE"
.LP
On success, zero is returned.
On error, \-1 is returned, and the Slurm error code is set appropriately.
The function \fBslurm_update_job2\fR returns zero if the \fIresp\fP array is
filled, in which the that array should be examined to determine the error codes
for individual tasks of a job array.
Then call the function \fBslurm_free_job_array_resp\fR to release memory
allocated for the response array.

.SH "ERRORS"
.LP
\fBSLURM_PROTOCOL_VERSION_ERROR\fR Protocol version has changed, re\-link your
code.
.LP
\fBESLURM_ACCESS_DENIED\fR The requesting user lacks authorization for
the requested action (e.g. trying to modify another user's job).
.LP
\fBESLURM_INVALID_JOB_ID\fR  Invalid job or step ID value.
.LP
\fBESLURM_INVALID_TIME_VALUE\fR  Invalid time value.

.SH "EXAMPLE"
.LP
#include <stdio.h>
.br
#include <slurm/slurm.h>
.br
#include <slurm/slurm_errno.h>
.LP
int main (int argc, char *argv[])
.br
{
.br
	job_desc_msg_t              update_job_msg;
.br
	step_update_request_msg_t   update_step_msg;
.LP
	slurm_init_job_desc_msg( &update_job_msg );
.br
	update_job_msg.job_id = 1234;
.br
	update_job_msg time_limit = 200;
.br
	if (slurm_update_job (&update_job_msg)) {
.br
		slurm_perror ("slurm_update_job error");
.br
		exit (1);
.br
	}
.LP
	slurm_init_update_step_msg( &update_step_msg );
.br
	update_step_msg.job_id = 1234;
.br
	update_step_msg.step_id = 2;
.br
	update_step_msg time_limit = 30;
.br
	if (slurm_update_step (&update_step_msg)) {
.br
		slurm_perror ("slurm_update_step error");
.br
		exit (1);
.br
	}
.br
	exit (0);
.br
}

.SH "NOTE"
These functions are included in the libslurm library,
which must be linked to your process for use
(e.g. "cc \-lslurm myprog.c").

.SH "COPYING"
Portions copyright (C) 2014 SchedMD LLC.
Portions copyright (C) 2009\-2010 Lawrence Livermore National Security.
Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
CODE\-OCEC\-09\-009. All rights reserved.
.LP
This file is part of Slurm, a resource management program.
For details, see <https://slurm.schedmd.com/>.
.LP
Slurm is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
.LP
Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
details.

.SH "SEE ALSO"
.LP
\fBscontrol\fR(1),
\fBslurm_free_job_array_resp\fR(3),
\fBslurm_get_errno\fR(3),
\fBslurm_perror\fR(3), \fBslurm_strerror\fR(3),
